import http from "@/api";

/**
 * 关键词列表
 */
export const keywordsListApi = (params: object) => {
    return http.get(`/keywords/list`, params);
};

/**
 * 关键词分页列表
 */
export const keywordsPageListApi = (params: object) => {
    return http.get(`/keywords/paging`, params);
};

/**
 * 新增关键词
 * @param params
 */
export const addKeywordsApi = (params: object) => {
    return http.post(`/keywords/add`, params);
};

/**
 * 编辑关键词
 * @param params
 */
export const editKeywordsApi = (params: any) => {
    return http.put(`/keywords/edit/${params.id}`, params);
};

/**
 * 切换关键词状态
 * @param id
 */
export const changeStatusApi = (id: number) => {
    return http.put(`/keywords/change_status/${id}`);
};

/**
 * 修改排序
 * @param params
 */
export const changeSortApi = (params: object) => {
    return http.post(`/keywords/changeSort`, params);
};

/**
 * 删除关键词
 * @param id
 */
export const deleteKeywordsByIdApi = (id: number) => {
    return http.delete(`/keywords/delete/${id}`);
};

/**
 * 批量删除
 * @param params
 */
export const deleteKeywordsApi = (params: object) => {
    return http.post(`/keywords/delete`, params);
};
